ci(release): bake ui/dist into tagged commit so go install ships UI#97
Merged
ci(release): bake ui/dist into tagged commit so go install ships UI#97
Conversation
Today the release workflow tags main HEAD. Main's tree gitignores every file under ui/dist/ except a placeholder index.html, so a `go install github.com/RandomCodeSpace/docsiq@vX.Y.Z` resolves a tree that embeds an empty UI — the binary 404s on every /assets/* request. Fix: in the release: job, after binaries are signed but before the tag is pushed, download the ui-dist artifact, force-add ui/dist/ on a detached HEAD, commit it, then tag that ephemeral commit as $TAG and push only the tag. Main itself is never modified — only the new tag is pushed to origin. proxy.golang.org sees the tagged tree (with embedded UI), so `go install ...@vX.Y.Z` produces a working binary. Prebuilt release binaries are unaffected (they already contained the UI because CI runs `npm run build` before `go build`).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
mainHEAD.main's tree gitignores every file underui/dist/except a placeholderindex.html, sogo install github.com/RandomCodeSpace/docsiq@vX.Y.Zresolves a tree that embeds an empty UI — the binary 404s on every/assets/*request.release:job download theui-distartifact, create an ephemeral commit on a detached HEAD withui/dist/force-added past.gitignore, then tag that commit as$TAGand push only the tag.mainitself is never modified — only the new tag is pushed to origin.proxy.golang.orgsees the tagged tree (with embedded UI), sogo install ...@vX.Y.Zproduces a working binary.npm run buildbeforego build.Why this approach
Two alternatives considered and rejected:
ui/dist/tomain. Bloats every PR diff with hashed bundle changes; couples source-of-truth to build output. Closed as PR fix(build): commit ui/dist/ sogo installships a working web UI #96.--ui-dirflag. Breaks the single-binary distribution promise.Tagging an off-main commit keeps
mainclean and givesgo installa tree it can actually use.Test plan
release.ymlwithbump=patchto cutv0.1.5git ls-tree v0.1.5 -- ui/dist/listsindex.htmlANDassets/*.js,assets/*.cssgit ls-tree origin/main -- ui/dist/still shows onlyindex.html(main untouched)GOPATH=/tmp/gopath GOFLAGS='-tags=sqlite_fts5' go install github.com/RandomCodeSpace/docsiq@v0.1.5produces a binarydocsiq serve --port 37792from that binary returns HTTP 200 onGET /and on at least 4/assets/<hash>.{js,css}pathsdocsiq-v0.1.5-linux-amd64still verifies via the cosign command in the release notes🤖 Generated with Claude Code